﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yun.Interface;
using Yun.Response;
using Yun.Util;

namespace Yun.IM.Request
{

    /// <summary>
    /// 发送群组消息方法
    /// yun.im.rongcloud.publish.group.set
    /// </summary>
    public class MessagePublishGroupRequest: ITopRequest<IntResultResponse>
    {
        /// <summary>
        /// 接收群组ID
        /// </summary>
        public int ToGroupId { get; set; }

        /// <summary>
        /// 发送消息内容
        /// </summary>
        public string Content { get; set; }


        public string GetApiName()
        {
            return "yun.im.rongcloud.publish.group.set";
        }


        public void Validate()
        {
            RequestValidator.ValidateRequired("togroupid", ToGroupId);
            RequestValidator.ValidateRequired("content", Content);
        }

        public IDictionary<string, string> GetParameters()
        {
            var parameters = new YunDictionary
            {
                {"togroupid", ToGroupId},
                {"content", Content}
            };

            return parameters;
        }

    }
}
